// Created from GenerationTemplate
// For Decisions HL7 Engine
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Reflection;
using DecisionsFramework.Design.Properties;
using Decisions.HL7.Generated.AbstractMessage;
using Decisions.HL7.DataTypes;
using ST = System.String;
using SI = System.String;
using TX = System.String;
using FT = System.String;
using IS = System.String;
using ID = System.String;
using SNM = System.String;

namespace Decisions.HL7.Message
{
    [DataContract]
	public class CWE : AbstractDataType
    {

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("1 Identifier",1)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST Identifier {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("2 Text",2)]
  	    [HL7Field(HL7Version.v231, 2, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v24, 2, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 2, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 2, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 2, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 2, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST Text {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("3 Name of Coding System",3)]
  	    [HL7Field(HL7Version.v231, 3, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v24, 3, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 3, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v251, 3, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v26, 3, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v27, 3, HL7Repeat.False, HL7Required.True,"ID")]
		[CodingSystem]
	    public ID NameofCodingSystem {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("4 Alternate Identifier",4)]
  	    [HL7Field(HL7Version.v231, 4, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v24, 4, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 4, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 4, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 4, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 4, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST AlternateIdentifier {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("5 Alternate Text",5)]
  	    [HL7Field(HL7Version.v231, 5, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v24, 5, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 5, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 5, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 5, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 5, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST AlternateText {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("6 Name of Alternate Coding System",6)]
  	    [HL7Field(HL7Version.v231, 6, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v24, 6, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 6, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v251, 6, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v26, 6, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v27, 6, HL7Repeat.False, HL7Required.True,"ID")]
		[CodingSystem]
	    public ID NameofAlternateCodingSystem {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("7 Coding System Version ID",7)]
  	    [HL7Field(HL7Version.v231, 7, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v24, 7, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 7, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 7, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 7, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 7, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST CodingSystemVersionID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("8 Alternate Coding System Version ID",8)]
  	    [HL7Field(HL7Version.v231, 8, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v24, 8, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 8, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 8, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 8, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 8, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST AlternateCodingSystemVersionID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("9 Original Text",9)]
  	    [HL7Field(HL7Version.v231, 9, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v24, 9, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 9, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 9, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 9, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 9, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST OriginalText {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("10 Second Alternate Identifier",10)]
  	    [HL7Field(HL7Version.v27, 10, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST SecondAlternateIdentifier {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("11 Second Alternate Text",11)]
  	    [HL7Field(HL7Version.v27, 11, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST SecondAlternateText {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("12 Name of Second Alternate Coding System",12)]
  	    [HL7Field(HL7Version.v27, 12, HL7Repeat.False, HL7Required.True,"ID")]
		[CodingSystem]
	    public ID NameofSecondAlternateCodingSystem {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("13 Second Alternate Coding System Version ID",13)]
  	    [HL7Field(HL7Version.v27, 13, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST SecondAlternateCodingSystemVersionID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("14 Coding System OID",14)]
  	    [HL7Field(HL7Version.v27, 14, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST CodingSystemOID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("15 Value Set OID",15)]
  	    [HL7Field(HL7Version.v27, 15, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST ValueSetOID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("16 Value Set Version ID",16)]
  	    [HL7Field(HL7Version.v27, 16, HL7Repeat.False, HL7Required.True,"DTM")]
	    public DTM ValueSetVersionID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("17 Alternate Coding System OID",17)]
  	    [HL7Field(HL7Version.v27, 17, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST AlternateCodingSystemOID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("18 Alternate Value Set OID",18)]
  	    [HL7Field(HL7Version.v27, 18, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST AlternateValueSetOID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("19 Alternate Value Set Version ID",19)]
  	    [HL7Field(HL7Version.v27, 19, HL7Repeat.False, HL7Required.True,"DTM")]
	    public DTM AlternateValueSetVersionID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("20 Second Alternate Coding System OID",20)]
  	    [HL7Field(HL7Version.v27, 20, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST SecondAlternateCodingSystemOID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("21 Second Alternate Value Set OID",21)]
  	    [HL7Field(HL7Version.v27, 21, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST SecondAlternateValueSetOID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("22 Second Alternate Value Set Version ID",22)]
  	    [HL7Field(HL7Version.v27, 22, HL7Repeat.False, HL7Required.True,"DTM")]
	    public DTM SecondAlternateValueSetVersionID {get;set;}





		public override string GetER7(HL7ParserOptions options) {
			List<string> dataTypeParts = new List<string>();
		    dataTypeParts.Add(Identifier);
		    dataTypeParts.Add(Text);
		    dataTypeParts.Add(NameofCodingSystem);
		    dataTypeParts.Add(AlternateIdentifier);
		    dataTypeParts.Add(AlternateText);
		    dataTypeParts.Add(NameofAlternateCodingSystem);
		    dataTypeParts.Add(CodingSystemVersionID);
		    dataTypeParts.Add(AlternateCodingSystemVersionID);
		    dataTypeParts.Add(OriginalText);
		    dataTypeParts.Add(SecondAlternateIdentifier);
		    dataTypeParts.Add(SecondAlternateText);
		    dataTypeParts.Add(NameofSecondAlternateCodingSystem);
		    dataTypeParts.Add(SecondAlternateCodingSystemVersionID);
		    dataTypeParts.Add(CodingSystemOID);
		    dataTypeParts.Add(ValueSetOID);
			dataTypeParts.Add(GetER7TextForDataPart(ValueSetVersionID, options));
		    dataTypeParts.Add(AlternateCodingSystemOID);
		    dataTypeParts.Add(AlternateValueSetOID);
			dataTypeParts.Add(GetER7TextForDataPart(AlternateValueSetVersionID, options));
		    dataTypeParts.Add(SecondAlternateCodingSystemOID);
		    dataTypeParts.Add(SecondAlternateValueSetOID);
			dataTypeParts.Add(GetER7TextForDataPart(SecondAlternateValueSetVersionID, options));
			return CleanUpTrailingComponentSeps(string.Join("" + options.ComponentSep, dataTypeParts.ToArray()), options);
		}
    }
}

